<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../node_modules/@vue/runtime-dom/dist/runtime-dom.global.js"></script>
    <div id="app"></div>
    <script>
        // 一个是dom平台下 ，一个是不依赖于平台 

        const { createApp, h,ref, reactive } = VueRuntimeDOM; // VueRuntimeCore
        let App = {
            setup() {
                const state = reactive({ name: 'x',age:17 })
                const age = ref(18)
                
                // 点击一次触发多次修改，
                function fn(){
                    state.name = 's';
                    state.name = 'ss';
                    age.value = 19
                }
                return () => {
                    return h('div',{ onclick: fn},`${state.name}:${age.value}`)
                }
            }
        }
        let app = createApp(App, { a: 1 }); // rootProps

        app.mount('#app')
    </script>
</body>

</html>